//
//  ViewController.m
//  20-HomeWorkLX
//
//  Created by GivenBmli on 16/8/10.
//  Copyright © 2016年 GivenBmli. All rights reserved.
//

#import "ViewController.h"
#import "CarBartuenTableViewCell.h"
#import "BaseModel.h"
#import "FindCar.h"
@interface ViewController ()<UITableViewDataSource ,UITableViewDelegate>
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic ,strong)FindCar *fireCar;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    [self handleData];
    
}

- (void)handleData {
   NSString *path = [[NSBundle mainBundle]pathForResource:@"AllCar" ofType:@"json"];
   NSData *data = [NSData dataWithContentsOfFile:path];
    NSError *erro = nil;
  NSDictionary *fisetDic =[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableLeaves error:&erro];
    self.fireCar = [FindCar modelWithDic:fisetDic];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 100;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    CarBartuenTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CarBrantIMage" forIndexPath:indexPath];
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
